<template>
  <FormDialog v-model:showMain="showMain" />
  <DocInfoPanel v-model:show="showDocInfo" />
</template>

<script setup lang="ts">
import { ref, onMounted, onUnmounted } from 'vue'
import { usePlugin } from '@/main'
import FormDialog from '@/components/FormDialog.vue'
import DocInfoPanel from '@/components/DocInfoPanel.vue'
import { EventHandlers, PluginManager } from '@/utils'

// 状态管理
const showMain = ref(false)
const showDocInfo = ref(false)

// 获取插件实例
const plugin = usePlugin()

// 创建事件处理器和插件管理器
const eventHandlers = new EventHandlers(showMain, showDocInfo)
const pluginManager = new PluginManager(plugin, eventHandlers)

// 生命周期
onMounted(() => {
  console.log('组件挂载，初始化插件')
  pluginManager.init()
})

onUnmounted(() => {
  console.log('组件卸载，清理资源')
  pluginManager.cleanup()
})
</script>

<style lang="scss">
// 全局样式
</style>